package framework.proxy;

import org.springframework.cglib.proxy.Enhancer;

public class MapPropertyUtil {
    @SuppressWarnings("unchecked")
    public static <T> T newObject(Class<T> clazz) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(clazz);
        enhancer.setInterfaces(new Class[]{MapProperty.class});
        enhancer.setCallback(new MapPropertyProxy());
        return (T) enhancer.create();
    }
}
